In the literature and on the market, many automatic focusing methods exist, which may be grouped into two big families: open-loop and the closed-loop approaches.
Open-loop approaches require a distance sensor, for example a time-of-flight sensor; for this reason they are also known as “active” approaches. An open-loop controller receives, as input, a signal issued from this sensor, representing the distance of a subject to be imaged, and uses it to generate a signal for controlling an actuator that acts upon a focusing parameter of the camera. The latter may be the distance between a lens and an image sensor, or indeed the vergence of the lens if the latter is deformable. Typically, the controller merely applies a predefined lookup table matching a distance measured by the sensor to a voltage or current level, delivered to the actuator. One advantage of this approach is that it is very fast. However, it has many drawbacks: the extra cost linked to the use of an active distance sensor, the need for a calibration to be carried out in order to construct the lookup table of the open-loop controller and for it to be repeated periodically in order to compensate for the drift of the optical module and of the actuator, and sensitivity to non-measurable disturbances that prevent a level of precision from being guaranteed (lack of robustness). An exemplary open-loop, or active, autofocus is given in the document U.S. Pat. No. 6,292,256.
Closed-loop approaches do not make use of a distance sensor (they are therefore known as “passive” approaches), but rather of a module for estimating quality, which extracts a quality metric—typically sharpness—from the obtained image. This estimation is compared to a reference value in order to deliver an error signal; a closed-loop controller acts upon an actuator in such a way as to minimize this error signal. Among the advantages of this approach, mention may be made of the absence of an active distance sensor, and the fact that disturbances and drift are taken into account without the need for calibration. In contrast, if the performance of the system is to be robust in the face of uncertainties in optical module performance (for example linked to technological variability), the control law must be chosen wisely, this requiring a certain level of expertise on the part of the designer. Furthermore, speed is reduced with respect to open-loop systems.
There are a wide variety of closed-loop approaches.
One conventional solution consists in carrying out a search for a maximum sharpness (an indicator of the image quality) using a so-called “climbing” method on a sharpness curve. For this, the image sharpness estimator receives a matrix of signals from the image sensor and uses it to calculate a sharpness indicator “n” according to a chosen metric. Next (considering, for the sake of simplicity, the single case of a system with a variable focus lens), the value y=∂n/∂f of the sharpness gradient is calculated with respect to the focal length of the lens f; this makes it possible to determine the direction of the control to be applied. An integral-type control law is subsequently used, this allowing the lens to be deformed in such a way as to approach the maximum of the sharpness. This solution has a certain number of drawbacks. First of all, the calculation of the sharpness gradient is, by nature, very sensitive to noise. Furthermore, the signal for controlling the actuator is typically quantized, implying that all of the focal lengths in a given continuous interval [fmin, fmax] are not actually attainable, leading to a degradation of the focusing precision. Decreasing the quantization step size allows focusing precision to be improved, but at the cost of increasing convergence time and power consumption. Parasitic oscillations may also occur about the optimum sharpness value.
The paper by Jie He et al. “Modified Fast Climbing Search Auto-focus Algorithm with Adaptive Step Size Searching Technique for Digital Camera”, IEEE Transaction on Consumer Electronics, 49(2): 257-262 (2003) describes a refinement of this approach, in which the quantization step size is chosen depending on the proximity to the maximum (larger far away from the maximum, and increasingly small as proximity thereto increases). This makes it possible, at least in principle, to improve response time and power consumption. However, reliably determining the proximity of the maximum is not simple: specifically, the sharpness gradient is generally low both close to the optimum focusing conditions and far away therefrom. In practice, the rules for readapting the gain are chosen assuming a priori knowledge of the behaviour of the optical module, whereas in cases of actual use, this behaviour is often different from that modelled—owing to, for example, technological variability and temperature drift—thereby leading to a loss of focusing performance.
Another possibility consists in using a PID (proportional-integral-derivative) controller with two additional degrees of freedom with respect to the purely integral control considered above. One advantage of this approach is that many proven methods for designing PID controllers are described in the literature. However, this type of control is worth considering only when the digital image sensor and the block for analyzing image sharpness operate at a speed comparable to or greater than that of the actuator of the lens (“slow lens”). Moreover, the model for which the PID controller has been setup does not allow the response time of the focusing system to be minimized because the model of the optical module changes depending on the scene in question. Furthermore, technological variability or even temperature drift implies that the actual module follows a model that is different to that used to set up the controller.
Yet another possibility consists in adopting a predictive approach, see, for example, the paper by L. I.-C. Chiu et al. “An efficient auto focus method for digital still camera based on focus value curve prediction model”, Journal of Information Science and Engineering, 26(4): 1261-1272, (2010). In this approach, the sharpness as a function of the position of the lens given by a sum of bell curves is assumed to be mathematically modelled, the parameters of which must be identified. The presented results suggest that this method allows a very fast convergence to be obtained, at least in the presence of a single sharpness peak—this, typically, corresponding to the presence of a single object in the imaged scene. However, in the presence of a plurality of objects, the identification of the parameters of the model is a non-linear and, in general, non-convex problem, the computational complexity of which risks becoming prohibitive.
The invention aims to overcome, entirely or in part, at least some of the aforementioned drawbacks. More precisely, the invention aims to provide an automatic focusing method that is both robust and fast and that does not require the use of an active distance sensor. The invention aims in particular to provide such a method that is well suited to the case of a “fast lens”, i.e. to a camera in which the response time of the actuator and of the optical module is less than the time required for the acquisition of the images and for the calculation of a sharpness metric.